package com.sap.tpcd.parserengine.wsdlfile;

import javax.xml.namespace.QName;

import org.apache.woden.WSDLException;
import org.apache.woden.XMLElement;
import org.apache.woden.wsdl20.extensions.ExtensionDeserializer;
import org.apache.woden.wsdl20.extensions.ExtensionElement;
import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
import org.apache.woden.wsdl20.xml.DescriptionElement;


/**
 * The Class PolicyExtensionDeserializer.
 *  @author sagara Gunathunga (sagaragu@gmail.com)
 */
public class PolicyExtensionDeserializer implements ExtensionDeserializer {

	/* (non-Javadoc)
	 * @see org.apache.woden.wsdl20.extensions.ExtensionDeserializer#unmarshall(java.lang.Class, java.lang.Object, javax.xml.namespace.QName, org.apache.woden.XMLElement, org.apache.woden.wsdl20.xml.DescriptionElement, org.apache.woden.wsdl20.extensions.ExtensionRegistry)
	 */
	public ExtensionElement unmarshall(Class parentType, Object parent,
			QName extType, XMLElement extEl, DescriptionElement desc,
			ExtensionRegistry extReg) throws WSDLException {
		PolicyExtension ele = (PolicyExtension) extReg.createExtElement(
				parentType, extType);

		ele.setExtensionType(extType);
		ele.setXMLElement(extEl);
		return ele;
	}

}
